Deriving The Formula For Gravitational Potential Energy